package com.dm.utils;

import java.util.HashMap;
import java.util.Map;

import com.alibaba.fastjson.JSON;


/**
 * 
* @ClassName: RespsonseResult  
* @Description: TODO(这里用一句话描述这个类的作用)  
* @author qiuxl24710  
* @date 2018年11月15日  
*
 */
public class RespsonseResult {

	private Object data;

	private String msg = " 执行失败";

	private String code = "1";
	
	private Map<String,Object> otherInfo = new HashMap<String,Object>();
	
	public void putOtherInfo(String key,Object value){
		otherInfo.put(key, value);
	}
	

	public RespsonseResult() {
		super();
	}

	public RespsonseResult(Object data) {
		super();
		this.data = data;
	}

	public RespsonseResult(Object data, String msg, String code) {
		super();
		this.data = data;
		this.msg = msg;
		this.code = code;
	}


	@Override
	public String toString() {
		try {
			return JSON.toJSON(this).toString();
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return "ResponseBody [data=" + data + ", msg=" + msg + ", msg=" + code + "]";
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}


	public Map<String, Object> getOtherInfo() {
		return otherInfo;
	}


	public void setOtherInfo(Map<String, Object> otherInfo) {
		this.otherInfo = otherInfo;
	}

	
	
}
